package calorie.com.calorie.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.TextView;

import butterknife.BindView;
import butterknife.ButterKnife;
import calorie.com.calorie.R;

public class MallFinishDetailActivity extends AppCompatActivity {

    @BindView(R.id.goods_detail_name)
    TextView goodsDetailName;
    @BindView(R.id.goods_detail_price)
    TextView goodsDetailPrice;
    @BindView(R.id.goods_detail_no)
    TextView goodsDetailNo;
    @BindView(R.id.the_goods_name)
    TextView theGoodsName;
    @BindView(R.id.the_goods_phone)
    TextView theGoodsPhone;
    @BindView(R.id.the_goods_address)
    TextView theGoodsAddress;
    @BindView(R.id.the_goods_create_time)
    TextView theGoodsCreateTime;

    String goodsName, goodsPrice, orderId, receiveName, receivePhone, receiveAdreess, orderCreateTime;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_mall_finish_detail);
        ButterKnife.bind(this);
        Intent intent = getIntent();
        if (intent != null) {
            goodsName = intent.getStringExtra("goodsName");
            goodsPrice = intent.getStringExtra("goodsPrice");
            orderId = intent.getStringExtra("orderId");
            receiveName = intent.getStringExtra("shippedName");
            receivePhone = intent.getStringExtra("shippedPhone");
            receiveAdreess = intent.getStringExtra("shippedAddress");
            orderCreateTime = intent.getStringExtra("goodsCreateTime");
            initDetail();
        }

    }

    private void initDetail() {
        goodsDetailName.setText(goodsName);
        goodsDetailPrice.setText(goodsPrice);
        goodsDetailNo.setText(orderId);
        theGoodsName.setText(receiveName);
        theGoodsPhone.setText(receivePhone);
        theGoodsAddress.setText(receiveAdreess);
        theGoodsCreateTime.setText(orderCreateTime);

    }
}
